package com.walker.spring.listener;

import com.walker.spring.event.DemoEvent;
import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

/**
 * @author qinmu
 * @create 2017-10-16-22:22
 */
@Component
public class DemoListener implements ApplicationListener<DemoEvent>{
    @Override
    public void onApplicationEvent(DemoEvent demoEvent) {
        String message = demoEvent.getMessage();
        System.out.println("demoListener接收到了demoPublisher发布的消息:"+message);
    }
}
